{% extends "base.html" %}

{% block title %}登录日志 - 网站管理后台{% endblock %}

{% block content %}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
    <h1 class="h2">登录日志</h1>
</div>

<div class="table-responsive">
    <table class="table table-striped table-hover">
        <thead>
            <tr>
                <th>ID</th>
                <th>用户ID</th>
                <th>用户名</th>
                <th>IP</th>
                <th>用户代理</th>
                <th>状态</th>
                <th>消息</th>
                <th>创建时间</th>
            </tr>
        </thead>
        <tbody>
            {% for log in logs %}
            <tr>
                <td>{{ log[0] }}</td>
                <td>{{ log[1] }}</td>
                <td>{{ log[2] }}</td>
                <td>{{ log[3] }}</td>
                <td>{{ log[4] or '-' }}</td>
                <td>
                    {% if log[5] == 1 %}
                        <span class="badge bg-success">成功</span>
                    {% else %}
                        <span class="badge bg-danger">失败</span>
                    {% endif %}
                </td>
                <td>{{ log[6] or '-' }}</td>
                <td>{{ log[7] }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}